<p-dialog [(visible)]="display" modal="modal"  [responsive]="true" [width]="width" (onHide)="closeInspectionPointMask(false)">
  <p-header>
    {{title}}
  </p-header>
  <div class="ui-g">
    <div class="ui-g-12">
      <div class="file-box">
        <form class="form-horizontal" [formGroup]="reportForm"  >
          <div class="form-group">
            <label  class="col-sm-2 control-label"><span>*</span>巡检点名称:</label>
            <div class="col-sm-9">
              <input type="text" name="reportType" class="form-control"  formControlName="name" [(ngModel)]="submitAddInspection.name" *ngIf="state ==='add'">
              <input type="text" name="reportType" class="form-control"  formControlName="name" [(ngModel)]="currentInspection.name" *ngIf="state ==='update'">
              <div class="ui-message ui-messages-error ui-corner-all"  *ngIf="!reportForm.controls['name'].valid&&(!reportForm.controls['name'].untouched)" >
                <i class="fa fa-close"></i>
                巡检点名称必填
              </div>
            </div>
          </div>
          <div class="form-group">
            <label  class="col-sm-2 control-label"><span>*</span>标签类型:</label>
            <div class="col-sm-9 ui-fluid">
              <p-dropdown [options]="statusNames" [(ngModel)]="submitAddInspection.flag_type" [autoWidth]="false" name="flag_type" formControlName="flag_type" *ngIf="state ==='add'"></p-dropdown>
              <p-dropdown [options]="statusNames" [(ngModel)]="currentInspection.flag_type" [autoWidth]="false" name="flag_type" formControlName="flag_type" *ngIf="state ==='update'"></p-dropdown>
            </div>
          </div>
          <div class="form-group">
            <label  class="col-sm-2 control-label"><span>*</span>巡检点标签:</label>
            <div class="col-sm-9">
              <input type="text" name="reportname" class="form-control" formControlName="flag" [(ngModel)]="submitAddInspection.flag" *ngIf="state ==='add'">
              <input type="text" name="reportname" class="form-control" formControlName="flag" [(ngModel)]="currentInspection.flag" *ngIf="state ==='update'" readonly>
              <div class="ui-message ui-messages-error ui-corner-all"  *ngIf="!reportForm.controls['flag'].valid&&(!reportForm.controls['flag'].untouched)" >
                <i class="fa fa-close"></i>
                巡检点标签必填
              </div>
            </div>
          </div>
          <div class="form-group">
            <label  class="col-sm-2  control-label"><span>*</span>关联区域:</label>
            <div class="col-sm-9 ui-fluid">
              <p-dropdown [autoWidth]="false"  [options]="region" formControlName="region"  name="fenlei" [(ngModel)]="submitAddInspection.region" *ngIf="state ==='add'"></p-dropdown>
              <p-dropdown [autoWidth]="false"  [options]="region" formControlName="region"  name="fenlei" [(ngModel)]="currentInspection.region" *ngIf="state ==='update'"></p-dropdown>
              <div class="ui-message ui-messages-error ui-corner-all"  *ngIf="!reportForm.controls['region'].valid&&(!reportForm.controls['region'].untouched)" >
                <i class="fa fa-close"></i>
                关联区域必填
              </div>
            </div>
          </div>
          <div class="form-group">
            <label  class="col-sm-2 control-label">巡检顺序:</label>
            <div class="col-sm-9">
              <input type="number" name="point_order" class="form-control" placeholder="只能填数字" formControlName="point_order" [(ngModel)]="submitAddInspection.point_order" *ngIf="state ==='add'" >
              <input type="number" name="point_order" class="form-control" placeholder="只能填数字" formControlName="point_order" [(ngModel)]="currentInspection.point_order"  *ngIf="state ==='update'">
            </div>
          </div>

        </form>
      </div>
    </div>
  </div>
  <p-footer>
    <button type="button" pButton icon="fa-check" label="确定" (click)="formSubmit(false)"  [disabled]="!reportForm.valid"></button>
    <button type="button" pButton icon="fa-close"  label="取消" (click)="closeInspectionPointMask(false)"></button>
  </p-footer>
</p-dialog>
